package Array;

import java.util.Arrays;

public class TestArray {
    public static void main(String[] args) {
        //1.char类型静态数组
         char[] a = {'h','e','l','l','o'};
         char[] b = new char[]{'h','e','l','l','o'};
        //2.char类型动态数组】
        char[] c = new char[5];
        c[0]='h';
        c[1]='e';
        c[2]='l';
        c[3]='l';
        c[4]='o';//0~4表示长度为5
        System.out.println(a);//char类型可以直接打印数组中具体内容：hello
        System.out.println(b);
        System.out.println(c);

        //3.String类型的静态数组
        String[]  s = {"a","b","c"};
        System.out.println(s);//[Ljava.lang.String;@1b6d3586
        //Arrays.toString(s)方法才能打印【查看】数组内容
        System.out.println(Arrays.toString(s));//[a, b, c]


    }
}
